]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Fix math to calculate the interval from the duration
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 14 Mar 2013 20:58:20 +0000 (16:58 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 14 Mar 2013 21:48:07 +0000 (17:48 -0400)
The math here before was incorrect. This is still wrong, as we're
looking at the total duration of the animation rather than the next
step.

https://bugzilla.gnome.org/show_bug.cgi?id=695882

js/ui/background.js

index 9e3e0099dc11394b4e704e557dc8d368096a0c78..bf8757eace520dde955c72c6451441a95fc71f77 100644 (file)
@@ -442,8 +442,11 @@ const Background = new Lang.Class({
         if (!this._animation.duration)
             return;
 
+        let nSteps = 255 / ANIMATION_OPACITY_STEP_INCREMENT;
+        let timePerStep = (this._animation.duration * 1000) / nSteps;
+
         let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000,
-                                ANIMATION_OPACITY_STEP_INCREMENT / this._animation.duration);
+                                timePerStep);
         this._animationUpdateTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
                                                       interval,
                                                       Lang.bind(this, function() {